package com.feign.controller;

import com.common.pojo.Dept;
import com.feign.service.DeptFeignService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @Author Str
 * @Date 2022/1/16 14:01
 * @Description :
 */
@RestController
@RequestMapping("/deptFeign")
public class DeptFeignController {
    @Autowired
    private DeptFeignService deptFeignService;

    // 获取一条信息
    // http://localhost:9401/deptFeign/getDeptById?id=1
    @GetMapping("/getDeptById")
    String getDeptById(@RequestParam("id") Integer id){
        Dept dept = deptFeignService.getDeptById(id);
        return dept+"<br/>"+"DeptFeignController.getDeptById";
    }

    // 获取长等待信息
    // http://localhost:9401/deptFeign/getLongTime
    @GetMapping("/getLongTime")
    String getLongTime(){
        return deptFeignService.getLongTime();
    }

    // 获取短等待信息
    // http://localhost:9401/deptFeign/getShortTime
    @GetMapping("/getShortTime")
    String getShortTime(){
        return deptFeignService.getShortTime();
    }
}
